# coding=utf-8
import time
from selenium import webdriver


driver = webdriver.Firefox()
driver.implicitly_wait(6)
driver.get("https://www.baidu.com")
time.sleep(1)
driver.execute_script('alert("输入框标红了!")')
time.sleep(2)
#print "==============",driver.switch_to_alert().text()
#driver.switch_to_alert().accept()  # 点击弹出里面的确定按钮
#driver.switch_to_alert().dismiss() # 点击弹出上面的X按钮